import OpenPage from './open.vue'
import Vue from 'vue'
let instance
const Ctr = Vue.extend(OpenPage)
export default function(url, target) {
  let openPage = document.body.querySelector('.open-page-container')
  if (!openPage) {
    openPage = document.createElement('div')
    openPage.classList.add('open-page-container')
    document.body.appendChild(openPage)
  }
  if (!instance) {
    instance = new Ctr()
  }
  instance.url = url
  instance.target = target
  instance.title = '打开外部链接'
  instance.message = url
  instance.show = true
  instance.$mount(openPage)
}
